#!/usr/bin/env node

const {readFile} = require('fs/promises');

const file = process.argv[2] ?? __filename;
async function main() {
  try {
    const data = await readFile(file, 'utf8');
    console.log(data);
  } catch (err) {
    console.error('Error reading file:', err.message);
  }
}

main();

// ./02-my-cat-promise.js ./01-my-cat-async.js 